/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.devmng.service;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.devmng.dao.TaskDelayApplyLogDao;
import com.thinkgem.jeesite.modules.devmng.entity.TaskDelayApplyLog;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 任务延迟申请记录Service
 *
 * @author yfy
 * @version 2018-02-03
 */
@Service
@Transactional(readOnly = true)
public class TaskDelayApplyLogService extends CrudService<TaskDelayApplyLogDao, TaskDelayApplyLog> {

    public TaskDelayApplyLog get(String id) {
        return super.get(id);
    }

    public List<TaskDelayApplyLog> findList(TaskDelayApplyLog taskDelayApplyLog) {
        return super.findList(taskDelayApplyLog);
    }

    public Page<TaskDelayApplyLog> findPage(Page<TaskDelayApplyLog> page, TaskDelayApplyLog taskDelayApplyLog) {
        Page<TaskDelayApplyLog> taskDelayApplyLogPage = super.findPage(page, taskDelayApplyLog);
        List<TaskDelayApplyLog> tdList = taskDelayApplyLogPage.getList();
        for (int i = 0; i <=taskDelayApplyLogPage.getList().size() -1; i ++) {
            TaskDelayApplyLog temp = new TaskDelayApplyLog();
            temp = tdList.get(i);
            temp.setCreateName(UserUtils.get(temp.getCreateBy().getId()));
            tdList.set(i,temp);
        }
        taskDelayApplyLogPage.setList(tdList);
        return taskDelayApplyLogPage;
    }

    @Transactional(readOnly = false)
    public void save(TaskDelayApplyLog taskDelayApplyLog) {
        super.save(taskDelayApplyLog);
    }

    @Transactional(readOnly = false)
    public void delete(TaskDelayApplyLog taskDelayApplyLog) {
        super.delete(taskDelayApplyLog);
    }

}